﻿using UnityEngine.Playables;
using UnityEngine;

namespace Pvp.Timeline
{
    /// <summary>
    /// 动画
    /// </summary>
    public class RoleAnimationClipBehaviour : BaseRolePlayableBehaviour
    {
        public AnimationClip animationClip;

        public override void ProcessFrame(Playable playable, FrameData info, object playerData)
        {
            var time = (float)playable.GetTime();
            var tt = Mathf.Clamp(time, 0, animationClip.length);
            animationClip.SampleAnimation(entity.unityObj, tt);
        }
    }
}



